package com.xiaoyu.izf.controller;

import com.xiaoyu.izf.model.Vocation;
import com.xiaoyu.izf.service.VocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 商户类别及行业
 */
@Controller
@RequestMapping("/vocation")
public class VocationController extends BaseController {
	@Autowired
	private VocationService vocationService;

	/**
	 * 行业
	 * @param request
	 * @param parentId
	 * @return
	 */
	@RequestMapping("/type")
	@ResponseBody
	public List<Vocation> vocations(HttpServletRequest request, int parentId) {
		return vocationService.findByParentId(parentId);
	}
}
